package com.xszx.service.impl;

import com.xszx.beans.User;
import com.xszx.dao.UserDao;
import com.xszx.service.UserService;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.io.FileNotFoundException;
import java.io.FileReader;

/**
 * @Author 信思智学
 * @Date 2024/8/20 9:33
 * @Description
 */
@Service
public class UserServiceImpl implements UserService {

    private SqlSessionTemplate sqlSessionTemplate;

    @Autowired
    public void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate) {
        this.sqlSessionTemplate = sqlSessionTemplate;
    }

    @Override
    public void addUser(User user) {

        UserDao userDao = sqlSessionTemplate.getMapper(UserDao.class);

        userDao.addUser(user);
    }




}
